#include "precompiled.h"
#include "frm_filler_test.h"
using namespace frm;
using namespace filler;
using namespace cursor;
using namespace test;

// TWindowF ///////////////////////////////////////////////////////////////////

//
TWindowF::TWindowF()
{
  Filler.Set(TArray()
   .Add(TColor(255,255,255))
   .Add(TLineVertCenter(192,192,192))
   .Add(TLineHorzCenter(192,192,192))
  );
  
  Cursor.Set(TCursorWin(IDC_CROSS));
}

//
void TWindowF::TWindow_Paint(grf::TPaint &grfPaint)
{
  grf::TRect ClientRect = GetClientRect();
  TComponent Component;
  TPaint     Paint;

  Paint.State        = TPaint::EState_PaintAll;
  Paint.DC           = grfPaint.DC;
  Paint.RClientPaint = grfPaint.DC.RClientPaint;

  Paint.GRect.RParent = ClientRect;
  Paint.GRect.RParentVisible = ClientRect;

  Paint.GRect.RThis = ClientRect;
  Paint.GRect.RThisVisible = ClientRect;

  Filler.Paint(Component,Paint);
}

//
void TWindowF::TWindow_Mouse(grf::TMouse &Mouse) 
{
  Cursor.Paint();
}

///////////////////////////////////////////////////////////////////////////////

//
void frm::filler::test::Test()
{
  TWindowF Win;
  
  Win.SetWindowRect(grf::TRect(100,100,600,600),false);
  Win.Show();
  Win.MessagesLoop();
}
